/*
 * Copyright (c) 2021-2021
 *
 * Project :  Advance Software Development - Exam Scheduling System with DFS
 * Class name :  io.robbinespu.ess.service.NodeService
 * Last modified:  5/29/21, 4:13 PM
 * User : Robbi Nespu < robbinespu@gmail.com >
 *
 * License : https://github.com/RobbiNespu/ESS/LICENSE
 */

package io.robbinespu.ess.service;

import io.robbinespu.ess.model.Nodes;
import io.robbinespu.ess.repo.NodeRepo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class NodeService implements INodeServices {
  public final NodeRepo nodeRepo;

  @Autowired
  public NodeService(NodeRepo nodeRepo) {
    this.nodeRepo = nodeRepo;
  }

  @Override
  public Nodes save(Nodes nodes) {
    return nodeRepo.save(nodes);
  }

  @Override
  public int sizeParentSubject(String subjectId) {
    return this.nodeRepo.sizeParentSubject(subjectId);
  }
}
